package com.appwoo.txtws.service;

import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Service;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.content.res.Resources;
import android.os.IBinder;
import com.appwoo.txtws.activity.MainTabActivity;
import com.appwoo.txtws.bean.StateBean;
import com.appwoo.txtws.component.Global;
import com.appwoo.txtws.component.Logger;
import java.util.List;

public class ParentKeepAlive extends Service
{
  public Thread KeepAliveSThread = new Thread()
  {
    public void run()
    {
      List localList = RQKeepAlive.getInstance().callKeep(ParentKeepAlive.this);
      if ((localList != null) && (localList.size() > 1));
      for (int i = 1; ; i++)
      {
        if (i >= localList.size())
        {
          SharedPreferences localSharedPreferences = ParentKeepAlive.this.getSharedPreferences("timeconfig" + Global.getTodayDate(ParentKeepAlive.this), 0);
          SharedPreferences.Editor localEditor = localSharedPreferences.edit();
          long l = 1L + localSharedPreferences.getLong("usetime", 0L);
          Logger.d("xjf", "记录使用时间：" + l);
          localEditor.putLong("usetime", l);
          localEditor.commit();
          return;
        }
        StateBean localStateBean = (StateBean)localList.get(i);
        Logger.e("admin", localStateBean.getCode() + "  ,  " + localStateBean.getMsgtitle() + "  ,  " + localStateBean.getMsgcontent());
        ParentKeepAlive.this.notification(localStateBean.getMsgtitle(), localStateBean.getMsgcontent());
      }
    }
  };

  private void notification(String paramString1, String paramString2)
  {
    NotificationManager localNotificationManager = (NotificationManager)getSystemService("notification");
    Notification localNotification = new Notification();
    localNotification.icon = 2130837742;
    localNotification.tickerText = getResources().getString(2131427331);
    localNotification.when = System.currentTimeMillis();
    Intent localIntent = new Intent(this, MainTabActivity.class);
    localIntent.putExtra("jg", "jg");
    PendingIntent localPendingIntent = PendingIntent.getActivity(this, 0, localIntent, 0);
    localNotification.flags = (0x10 | localNotification.flags);
    localNotification.setLatestEventInfo(this, paramString1, paramString2, localPendingIntent);
    localNotificationManager.notify(1, localNotification);
  }

  public IBinder onBind(Intent paramIntent)
  {
    return null;
  }
}

/* Location:           C:\Documents and Settings\Administrator\classes_dex2jar.jar
 * Qualified Name:     com.appwoo.txtws.service.ParentKeepAlive
 * JD-Core Version:    0.6.2
 */